package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.example.helloandroid.beans.AccountDTO;
import com.example.helloandroid.rest.client.AccountRestClient;
import com.example.helloandroid.rest.client.AccountRestClientImpl;

public class HelloAndroid extends Activity {
	
	private static final String TAG = "HelloAndroid";
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        AccountRestClient accountRestClient = new AccountRestClientImpl();
        String result = "";
        try {
        	AccountDTO accountDTO = accountRestClient.getBalanceFromIdConto("85");
        	result = accountDTO.toString();
		} catch (Exception e) {
			Log.v(TAG, e.getMessage());
			result = e.getMessage();
		}

        TextView tv = new TextView(this);
        tv.setText(result);
        setContentView(tv);
    }
}